<template>
  <div>
    <nav-bar :title="title" :isShow="false"></nav-bar>
    <van-cell title="企业合规调查问卷" icon="notes-o" />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
    >
     <van-cell icon="comment-o" v-for="item in invests" :key="item.id" :title="item.name" size="large" is-link :to="{name: 'Question', query:{invest_id:item.id} }"/>
    </van-list>
  </div>
</template>

<script>
import NavBar from "@/components/NavBar"
import { get_invest_list } from '@/api/question'

export default {
  name: "Investigation",
  components: {
    NavBar
  },

  data() {
    return {
      title: this.$route.meta.title,
      openid: "",
      invests: [],
      loading: false,
      finished: false,

    };
  },
  computed:{

  },
  methods: {
    getInvests(){
        get_invest_list().then(res=>{
          console.log(res.data);
          this.invests = res.data;
          this.loading = false
          this.finished = true
        }).catch(error => {
          if (error.response) {
            console.log(error.response.data);
          } else if (error.request) {
            console.log(error.request);
          } else {
            console.log('Error', error.message);
          }
          console.log(error.config);
        })
    },

  },
  created() {
    this.getInvests();
  },
};
</script>

<style  scoped>
</style>